package com.jean.com.retrofittest.task;

import com.jean.com.retrofittest.HttpMethods;

import retrofit2.Retrofit;
import rx.Observable;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * Created by jean on 2016/5/11.
 */
abstract class AbstractTask{
    public Retrofit mRetrofit;
    public AbstractTask(){
        mRetrofit = HttpMethods.getInstance().getmRetrofit();
        creatService();
    }
    public abstract void creatService();
    public  void toSubcribe(Observable o, Subscriber s){
        o.subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(s);
    };
}
